#include <iostream>
#include <vector>
#include <string>
using namespace std;

void Eat(string s, string cur, int no, vector<string> &res){
    if(no>3){
        if(s.length()==0){
            // ok, gone it
            res.push_back(cur.substr(1));
        }
        return;
    }
    // not begin with 0
    if(s.length() == 0)
        return;

    // eat one
    string tmp = cur;
    tmp.push_back('.');
    tmp.push_back(s[0]);
    Eat(s.substr(1), tmp, no+1, res);
    

    // eat two
    if(s.length()>1 && s[0] != '0'){
        tmp = cur;
        tmp.push_back('.');
        tmp += s.substr(0,2);
        Eat(s.substr(2), tmp, no+1, res);
    }
    // eat three
    if(s.length()>2 && s[0] != '0'){
        int val = (s[0]-'0')*100 + (s[1]-'0')*10 + (s[2]-'0');
        if(val<256){
            tmp = cur;
            tmp.push_back('.');
            tmp += s.substr(0,3);
            Eat(s.substr(3), tmp, no+1, res);
        }
    }
}



vector<string> restoreIpAddresses(string s) {
    // Start typing your C/C++ solution below
    // DO NOT write int main() function
    vector<string> res;
    string cur;
    Eat(s, cur, 0, res);
    return res;
}


int main(){

    restoreIpAddresses("010010");
    return 0;
}